/**
 * @File   : layout.tsx
 * @Author : xue.xiaoBing
 * @Date   : 2024/3/22 14:49
 * @Desc   : 首页
 * */

import Taro from '@tarojs/taro';
import {useLoad} from '@tarojs/taro';
import {Image, View} from '@tarojs/components'
import {NoticeBar} from '@nutui/nutui-react-taro';

import VideoShow from "@/pages/index/comments/video";
import TopSwiper from "@/pages/index/comments/topSwiper";

import wifiPng from '@/assets/images/wifi.png';

import './index.scss'


const text = '携手共进，在这个数字化的时代，我们热衷于探索前沿技术的力量，怀揣着共同的理想，那就是通过数字科技深度介入并积极改善日常生活。我们坚信，每一条代码、每一个算法、每一次技术创新，都在悄然编织出一个更智能、更便捷、更美好的未来世界。诚邀您一同踏上这段旅程，用我们的智慧和热情，让数字与技术碰撞出璀璨火花，深刻而持久地变革人们的生活方式，让我们共同见证并创造一个更加精彩的数字时代！'
export default function Index() {

  useLoad(() => {
    console.log('Page loaded.')
  })

  // 添加跳转事件
  const handleJumpEvent = (path) => {
    // @ts-ignore
    Taro.redirectTo({url: path})
  }

  return (
      <View className='home-page'>
        { /** 轮播图展示 */}
        <div className='top-show'>
          <TopSwiper />
        </div>
        { /** 公告提示 */}
        <div className='notice-show'>
          <NoticeBar>{text}</NoticeBar>
        </div>
        { /** 工具列表 */}
        <div className='service-show'>
          <div className='hint'>服务范围</div>
          <div className='tool-list'>
            <div className='tool-item' onClick={() => handleJumpEvent('/pages/code/index')}>
              <div className='tool-content'>
                <Image src={wifiPng} />
                <span>WIFI生成码</span>
              </div>
            </div>
            <div className='tool-item' onClick={() => handleJumpEvent('/pages/code/index')}>
              <div className='tool-content'>
                <Image src={wifiPng} />
                <span>WIFI生成码</span>
              </div>
            </div>
            <div className='tool-item' onClick={() => handleJumpEvent('/pages/code/index')}>
              <div className='tool-content'>
                <Image src={wifiPng} />
                <span>WIFI生成码</span>
              </div>
            </div>
            <div className='tool-item' onClick={() => handleJumpEvent('/pages/code/index')}>
              <div className='tool-content'>
                <Image src={wifiPng} />
                <span>WIFI生成码</span>
              </div>
            </div>
            <div className='tool-item' onClick={() => handleJumpEvent('/pages/code/index')}>
              <div className='tool-content'>
                <Image src={wifiPng} />
                <span>WIFI生成码</span>
              </div>
            </div>
          </div>
        </div>

        { /** 视频播放 */}
        <div className='video-show'>
          <div className='hint'>广告推广</div>
          <VideoShow />
        </div>
      </View>
  )
}
